package com.mi.fastbird.module;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

@Controller
public class HelloController {

    @RequestMapping("/index")
    public String index(HttpSession session, Model model) {
        return "/weixin/index.html";
        // 点击后,页面跳转至redirect_uri?code=CODE&state=STATE,企业可根据code参数获得员工的userid,code长度最大为512字节,CODE为企业微信返回值。
        //        return "redirect:https://open.weixin.qq.com/connect/oauth2/authorize?appid="
        //                + AppParam.getDictValueByNameCode("weixin", "app.id") + "&redirect_uri=" + redirectUrl
        //                + "&response_type=code&scope=SCOPE&agentid=" + AppParam.getDictValueByNameCode("weixin", "agent.id")
        //                + "&state=" + state + "#wechat_redirect";
    }

    @RequestMapping("/index2")
    public String index2(HttpSession session, Model model) {
        return "redirect:http://127.0.0.1:8101/weixin/index.html";
    }


}
